l205/Eind CSS/14.php
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
body{
float: left;
width: 150px;
border-style: dotted;
border-width: thin;
border-color: #999999;
padding: 10px;
margin: 20px;
}
</style>
</head>
<body>
<?php
$name = $_GET['name'];
$password = $_GET['password'];
if ($name && $password){
echo "Name: $name <div>
Password: $password";
}
elseif($name || $password) {
showform($name, $password, 'Je hebt niet alles ingevuld.');
}
else{
showform('', '', '');
}
function showform($name, $password, $message){
echo "<a
><form method='get' action =''>
Gebruikers naam:<div>
<input type='text' name='name' value='$name'> <div>
Wachtwoord: <div>
<input type='text' name='password' value='$password'> <div>
<p style='color: red';> $message </p><div>
<input type='submit' value='Login'></a>";
echo "</form>";
}
?>
</body>
</html>
Resultaat
Made by Thijs Aarnoudse